//
//  ImageTools.m
//  Happy Kitchen
//
//  Created by mac_chen on 15/3/10.
//  Copyright (c) 2015年 mac_chen. All rights reserved.
//

#import "ImageTools.h"

@implementation ImageTools

+ (NSMutableArray *)getImagesArray
{

    
    NSMutableArray *imageArray = [NSMutableArray arrayWithCapacity:6];
    
    for (int i = 1; i < 5; i++) {
    
        NSString *imageName = [NSString stringWithFormat:@"image%d", i];
        NSString *filePath = [[NSBundle mainBundle] pathForResource:imageName ofType:@"jpg"];
        UIImage *image = [[UIImage alloc] initWithContentsOfFile:filePath];
        [imageArray addObject:image];
        

    }
    // 取出第一个和最后一个
    UIImage *firstImage = [imageArray firstObject];
    UIImage *lastImage = [imageArray lastObject];
    
    // 放入数组的最前和最后面
    [imageArray insertObject:lastImage atIndex:0];
    [imageArray addObject:firstImage];
    
    return imageArray;
}

@end
